package com.ter;

import java.text.DecimalFormat;
import java.util.LinkedList;

public class Range {

	private Double minval;
	private Double maxval;
	private LinkedList<Double> t;
	Integer freqabs;
	Double freqrel;
	
	public Range(Double minval, Double maxval) {
		super();
		this.maxval = maxval;
		this.minval = minval;
		t=new LinkedList<>();

	}
	
	public Range(Integer minval, Integer maxval) {
		super();
		this.maxval = maxval.doubleValue();
		this.minval = minval.doubleValue();
		t=new LinkedList<>();

	}
	
	public String toString() {
		return "Range [minval=" + minval + ", maxval=" + maxval + ", t=" + t
				+ ", freqabs=" + freqabs + ", freqrel=" + freqrel + "]";
	}

	public boolean contient(Double v){
		if(v>= minval && v<= maxval) return true;
		else return false;
	}

	public String transformer(String sep){
		String line ="";
		line=line+minval.toString()+sep+maxval.toString()+sep+freqabs.toString()+sep+freqrel.toString();
		return line;
	}
	
	public LinkedList<Double> getT() {
		return t;
	}



	public void setT(LinkedList<Double> t) {
		this.t = t;
	}



	public Double getMaxval() {
		return maxval;
	}
	public void setMaxval(Double maxval) {
		this.maxval = maxval;
	}
	public Double getMinval() {
		return minval;
	}
	public void setMinval(Double minval) {
		this.minval = minval;
	}

	public int getFreqabs() {
		return freqabs;
	}
	
	public double getFreqrel() {
		return freqrel;
	}


	public void setFreqrel(double freqrel) {
		DecimalFormat df = new DecimalFormat("00000.00"); 
		String str = df.format(freqrel); 
		this.freqrel = Double.parseDouble(str.replace(',', '.')); 
	}


	public void setFreqabs(int freqabs) {
		this.freqabs = freqabs;
	}
	
	
	
	
}
